// stylelint-disable declaration-no-important

//
// Right side table of contents
//

.bd-toc {
  @supports (position: sticky) {
    position: sticky;
    top: $line-height-base * 4;
    height: subtract(100vh, $line-height-base * 4);
    overflow-y: auto;
  }
  order: 2;
}

.section-nav {
  padding-left: 0;

}

.toc-entry {
  display: block;

  a {
    display: block;

    &:hover {
      text-decoration: none;
    }
  }
}

//
// Left side navigation
//

.bd-sidebar {
  order: 0;
  // background-color: #f5f2f9;

  @include media-breakpoint-up(md) {
    @supports (position: sticky) {
      position: sticky;
      z-index: 1000;
      height: subtract(100vh, 4rem);
    }
  }

  @include media-breakpoint-up(xl) {
    flex: 0 1 320px;
  }
}

.bd-links {

  @include media-breakpoint-up(md) {
    @supports (position: sticky) {
      max-height: subtract(100vh, 9rem);
      overflow-y: auto;
    }
  }

  // Override collapse behaviors
  @include media-breakpoint-up(md) {
    display: block !important;
  }
}

.bd-search {
  position: relative; // To contain the Algolia search

}

.bd-search-docs-toggle {
  line-height: 1;
}

.bd-sidenav {
  display: none;
}

.bd-toc-link {
  display: block;

  &:hover {
    text-decoration: none;
  }
}

.bd-toc-item {
  &.active {
    margin-bottom: 1rem;

    > .bd-toc-link {

      &:hover {
        background-color: transparent;
      }
    }

    > .bd-sidenav {
      display: block;
    }
  }
}

// All levels of nav
.bd-sidebar .nav > li > a {
  display: block;
}

.bd-sidebar .nav > li > a:hover {
  text-decoration: none;
  background-color: transparent;
}

.bd-sidebar .nav > .active > a,
.bd-sidebar .nav > .active:hover > a {
  background-color: transparent;
}
